#include "CRC.h" // Only need to include this header file!
// No libraries need to be included. No project settings need to be messed with.

#include <iomanip>  // Includes ::std::hex
#include <iostream> // Includes ::std::cout
#include <cstdint>  // Includes ::std::uint32_t
#include <string.h>
#include "crcutil.h"

using namespace std;

int main(int argc, char ** argv)
{
	const char myString[] = { 'H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D' };
	string s = "puremvc-csharp-standard-framework";
	size_t len = s.length();
	char buffer[512];
	memset(buffer, 0, sizeof(buffer));
	sprintf_s(buffer, sizeof(buffer), "%s", s.c_str());

	std::uint32_t crc = CRC::Calculate(buffer, len, CRC::CRC_32());

	std::cout << std::hex << crc << std::endl;

	s = "csb";
	len = s.length();
	memset(buffer, 0, sizeof(buffer));
	sprintf_s(buffer, sizeof(buffer), "%s", s.c_str());

	crc = CRC::Calculate(buffer, len, CRC::CRC_8());

	std::cout << std::hex << crc << std::endl;


	string file = "/data/user/0/com.yh.sszg.demo/files/assets/src/D48A2F7C/7D6D3776.luac";
	string path = make_crc_path(file);
	std::cout << path << std::endl;

	return 0;
}